import Vue from 'vue'
import Router from 'vue-router'
import componentIndex from "@/components/home";
Vue.use(Router)
// 不作为Main组件的子页面展示的页面单独写，如下
export const loginRouter = {
	path: "/login",
	name: "login",
	hidden: true,
	meta: {
		title: "Login - 登录"
	},
	component: () => import("@/views/login/login")
};

export const page404 = {
	path: "/404",
	name: "error_404",
	hidden: true,
	meta: {
		title: "404-页面不存在"
	},
	component: () => import("@/components/error_page/404.vue")
};

export const page403 = {
	path: "/403",
	hidden: true,
	meta: {
		title: "403-权限不足"
	},
	name: "error_403",
	component: () => import("@/components/error_page/403.vue")
};

export const page500 = {
	path: "/500",
	hidden: true,
	meta: {
		title: "500-服务端错误"
	},
	name: "error_500",
	component: () => import("@/components/error_page/500.vue")
};


export const appRouter = [{
	path: "/",
	access: "/",
	name: "首页",
	redirect: '/home',
	meta: {
		title: "主页",
		icon: "&#xe681;",
	},
	component: componentIndex,
	children: [{
			path: "home",
			access: "/home",
			name: "/home",
			meta: {
				title: "14#机终端"
			},
			component: () => import("@/views/system/home/index")
		}, {
			path: "terminal15",
			access: "/terminal15",
			name: "/terminal15",
			meta: {
				title: "15#机终端",
			},
			component: () => import("@/views/system/home/index")
		},
		{
			path: "terminal16",
			access: "/terminal16",
			name: "/terminal16",
			meta: {
				title: "16#机终端",
			},
			component: () => import("@/views/system/home/index")
		},
		{
			path: "terminal17",
			name: "/terminal17",
			meta: {
				title: "17#机终端",
			},
			component: () => import("@/views/system/home/index")
		},
		{
			path: "terminal18",
			name: "/terminal18",
			meta: {
				title: "18#机终端",
			},
			component: () => import("@/views/system/home/index")
		},
		{
			path: "terminal19",
			name: "/terminal19",
			meta: {
				title: "19#机终端",
			},
			component: () => import("@/views/system/home/index")
		},
		{
			path: "terminal20",
			name: "/terminal20",
			meta: {
				title: "20#机终端",
			},
			component: () => import("@/views/system/home/index")
		},
		{
			path: "terminal21",
			name: "/termina21",
			meta: {
				title: "21#机终端",
			},
			component: () => import("@/views/system/home/index")
		},
		{
			path: "terminal22",
			name: "/termina22",
			meta: {
				title: "22#机终端",
			},
			component: () => import("@/views/system/home/index")
		},
		{
			path: "terminal23",
			name: "/termina23",
			meta: {
				title: "23#机终端",
			},
			component: () => import("@/views/system/home/index")
		},
		{
			path: "terminal24",
			name: "/termina24",
			meta: {
				title: "24#机终端",
			},
			component: () => import("@/views/system/home/index")
		}
	]
}, {
	path: "/system",
	meta: {
		title: "预约管理",
		icon: "&#xe681;",
		hidden:false
	},
	component: componentIndex,
	children: [{
		path: "workOrder",
		meta: {
			hidden:false
		},
		component: () => import("@/views/system/workOrder")
	},{
		path: "workOrderClose",
		meta: {
			hidden:false
		},
		component: () => import("@/views/system/workOrderClose")
	},{
		path: "remnantWork",
		meta: {
			hidden:false
		},
		component: () => import("@/views/system/remnantWork")
	},{
		path: "remnantWork2",
		meta: {
			hidden:false
		},
		component: () => import("@/views/system/remnantWork2")
	},{
		path: "remnantWork3",
		meta: {
			hidden:false
		},
		component: () => import("@/views/system/remnantWork3")
	},{
		path: "machine",
		meta: {
			hidden:false
		},
		component: () => import("@/views/system/machine")
	},{
		path: "inMachine",
		meta: {
			hidden:false
		},
		component: () => import("@/views/system/inMachine")
	}]
}]



export const constantRouterMap = [loginRouter, page404, page500, page403, ...appRouter];


export default new Router({
	// mode: 'history',
	// base: process.env.BASE_URL,
	routes: constantRouterMap
})
